package com.hqyj.springboot.modules.test.dao;

import com.hqyj.springboot.modules.test.entity.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StudentDao extends JpaRepository<Student,Integer> {

    List<Student> findByStudentName(String studentName);

//    @Query(nativeQuery = true,value = "select * from test_student where id = :id")
    @Query(value = "from Student  where  id = :id")
    Student getStudentById(@Param("id") int id);



}
